#define _CRT_SECURE_NO_WARNINGS 1
//分数求和
#include<stdio.h>

int main()
{
	int n;
	float sum = 0;
	int i = 0;
	for (n = 1; n <= 100; n++)
	{
		if (0 == n % 2)
		{
			i = -1;
		}
		else
		{
			i = 1;
		}
		sum += i*(1.0 / n);
	}
	printf("%f\n", sum);
	return 0;
}